1. Field of the Invention
This invention generally relates to a method of setting or changing specific data entities in a record registered on disk through one atomic input/output (I/O) operation of a data processing system, and more particularly to a novel combination of a record format and a channel command word (CCW) string for performing such an I/O set or change operation in a single I/O access.
Furthermore, the invention provides a method of setting or changing specific data entities in a record on disk conditionally through an I/O operation in dependence on the value of the same or other data entities on disk as tested in the same atomic I/O operation and particularly to a record format and a channel command word (CCW) performing such an I/O test and set operation in a single I/O access.
The invention also relates to a shared disk facility (SDF) wherein said I/O test and set operation is used to avoid simultaneous and conflicting accesses from a plurality of independent computer systems having read and write access to the same physical disk storage devices.
2. Discussion of Related Art
Normally, at least two input/output operations of a data processing system are required to change specific data in a record registered on a disk or DASD (Direct Access Storage Device) while maintaining the rest of the record unaltered. The first I/O operation serves to transfer the entire record from disk to main memory, whereupon the data in memory is changed under control of a program running in the CPU, and subsequently the updated record is written back to the DASD in a second I/O operation, the new version overlaying the original.
In some instances it is desirable or even necessary to set or change data in a record registered on DASD under the guarantee that no other access takes place while the update is being made. Under such circumstances the above mentioned change in two successive I/O operations cannot be used, because other conflicting accesses might occur in between.
An example of the above is in a shared disk system, where a plurality of independent computer systems share one or more DASDs. Under a shared disk system, two or more independent computer systems have potential access to the same physical DASD. When a sharing system would need two successive I/O operations to update critical data on DASD, there would be a risk that another sharing system may start a conflicting update in between.
One solution of this problem has been to use the so-called "Reserve/Release" feature of DASD hardware, whereby upon an access from one system the entire DASD is excluded from all accesses of other systems.
In a single computer system, such as the IBM VM Operating System software, controlling DASD accesses maintains a DASD access status record in main memory containing flags for each minidisk (storage space allocated to one user) currently being accessed, and when a minidisk is flagged for writing by one user further access from other users is denied or suspended.
However, with shared DASD the participating computer systems have no access to the status records in each other's memories and, therefore, in a shared DASD system the access status record is maintained on the DASD itself.
Upon an access request for a minidisk on shared DASD, the corresponding flags in the status records on DASD have to be tested and to be changed or set in case the minidisk is available. When this change operation for updating the corresponding flag is effected in two or more I/O operations, other systems might access the same status record in between and initiate a conflicting update.
Under said "Reserve/Release" feature conflicting accesses are avoided by dedicating the DASD hardware-wise to the accessing system during the updating process, thus blocking the entire DASD, containing many megabytes of data, from any access by any other system until the updating process, including two or more I/O operations and the change under CPU control, has been completed. The accessing system first issues a DEVICE RESERVE command, through which the DASD is hardware-wise dedicated t other accessing system, whereupon the status record is read into memory with a first I/O operation, tested and changed if applicable under CPU control, and in a second I/O operation the status record is rewritten to DASD, whereupon a DEVICE RELEASE command is issued to make the DASD again accessible to other systems. And, if the test should not succeed at the first trial, further such attempts could be made until successful, each time blocking the device for some duration of time.
This rigorous blocking of the entire DASD has of course the disadvantage that all data on the DASD are temporarily inaccessible to other users on any other system during each update of the status record flags. This is the more undesirable in view of the extensive and ever increasing use of loosely coupled computer systems at large data processing facilities, resulting in an increasing use of shared DASD.
Another disadvantage of the known system is that the hardware blocking is maintained even if the accessing system should fail while holding the Device Reserve during the update operation, in which event interference of the operator is required to manually reset an outstanding Device Reserve. Until such interference, all data on the Reserved DASD, even the data to which access has been granted already, is unavailable to other users on other systems.
By contrast, with the I/O test and set operation of the present invention access flags on DASD can be tested and updated in one atomic I/O access operation, thus avoiding simultaneous and conflicting accesses and obviating the need for the Device Reserve/Release feature blocking the entire disk during the test and set operation.
In itself, a Test and Set instruction is a well-known tool operating on specific data bytes in memory for using the byte value in a conditional operation while setting the byte in memory to a predetermined value. Until now, however, test and set operations could not easily be realized in input/output operations of a data processing system.